package com.redhipps.hips.client.model;

import com.redhipps.hips.client.io.SerializedModel;

@Deprecated
public class Schedules {

  public static int[] startDateForSchedule(SerializedModel scheduleModel, int[] result) {
    String s = scheduleModel.stringProperty("start_time");
    String[] split = s.split("-");
    int year = Integer.parseInt(split[0]);
    int month = Integer.parseInt(split[1]) - 1;
    if (result == null) {
      result = new int[2];
    }
    result[0] = year;
    result[1] = month;
    return result;
  }

  public static void setStartDate(SerializedModel scheduleModel, int year, int month) {
    String s = String.valueOf(year) + "-" + String.valueOf(month) + "-1";
    scheduleModel.setProperty("start_time", s);
  }

  private Schedules() {}
}
